/** @file */ 


#ifndef ADC_H_
#define ADC_H_

#include <avr/io.h>

/**
  *	This function initializes the ADC. Thereby the ADC module is activated and the work frequency is set to F_CLK/32.
  * The reference voltage is set to AVCC (5V).
  * The sampled analogous signal is not allowed to be higher as the reference voltage.
  * The converted values are related to the interval [0-5]. The highest value (1023) for a measured analogous signal of 5V and the
  * lowest value (0) for 0V.
  */
void init_ADC();

/**
 * Starts a conversation of the analogous signal at the specified channel and returns the result of the conversation.
 */
uint16_t read_ADC(uint8_t channel);

/**
 * Like read_ADC, but two samples are taken and average value of the samples is returned
 */
uint16_t read_2_ADC(uint8_t channel);

/**
 * Like read_ADC, but four samples are taken and average value of the samples is returned
 */
uint16_t read_4_ADC(uint8_t channel);


#endif /* ADC_H_ */